home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
36
/
dvqmlfix.zip
/
ECHO_R.ZIP
/
ECHO_R.ASM
next >
Wrap
Assembly Source File
|
1986-11-21
|
3KB
|
64 lines
;
; ECHO_R: A remote ECHO for DOORS users.
;
; Courtesy of: The BBS of Excellence (312)398-2872
;
; To make this program work under COM2: change the constants as
; indicated. ANSI can be displayed by using "@" in place of esc.
;
cseg segment byte public 'CODE'
assume cs:cseg,ds:cseg,es:cseg
org 100h
ECHO_R proc near
jmp MainCode ; Skip over constant
;
DataReg dw 3F8h ; for COM1: 2F8h = COM2:
LineReg dw 3FDh ; for COM1: 2FDh = COM2:
;
MainCode:
Call WriteMsg ; If a message exists, then output it
Int 20h ; Terminate program
ECHO_R endp
WriteMsg Proc Near
mov SI,80h ; point to the command buffer
Xor CX,CX ; Init the loop counter
Mov CL,[SI] ; Get the input length
Cmp CL,0 ; Was there no input ?
JZ ExitWrite ; True...then exit
Inc SI ; Point past the length
WriteLoop:
Mov AH,2 ; Indicate screen write
Inc SI ; Point to next character
Mov DL,[SI] ; Get the character
Cmp DL,'@' ; Is this an Esc character ?
Jne WriteScreen ; No...continue
Mov DL,27 ; Change to a REAL Esc character
WriteScreen:
Int 21h ; Write character to the screen
Mov AL,[SI] ; Get the character
Cmp AL,'|' ; Is it an Esc request ?
Jne WriteCom ; No...continue
Mov AL,27 ; Change to a REAL Esc character
WriteCom:
Push AX ; Save the byte
WaitLineLoop:
Mov DX,LineReg ; Get the Line Register address xFDh
In AL,DX ; Get the Line status
And AL,20h ; Is the Xmit buffer empty ?
Cmp AL,20h ; Is it?
Jne WaitLineLoop ; No...Exit to caller
Pop AX ; Restore the byte
Mov DX,DataReg ; Point to output port
Out DX,AL ; Output the character
Loop WriteLoop ; Keep doing it until no more
ExitWrite:
Ret ; Return to main routine
WriteMsg Endp
Wait Endp
CSEG Ends
End ECHO_R